//设备新增
import commonRequest from '/@/api/common/common';
import { i18n } from '/@/locales/i18n';
const $t = i18n.global.t;

export default function (data: any) {
	const array = [
		{
			type: 'input',
			label: $t('zPt2u1IicB1YdF5SAoW'),
			key: 'v_TrainName',
			value: data.v_TrainName || '',
			rules: [{ required: true, message: $t('7LkKYu4Cp4ATlKfAm3kZ'), trigger: ['blur', 'change'] }],
			placeHolder: $t('ejYcD20WhpWujLo774okQ'),
		},
		{
			type: 'select',
			label: $t('5l5YuL8GqygDd3SsO004'),
			key: 'n_PlanCourse',
			value: data.v_CourseName || '',
			placeHolder: $t('ehhbmuhU8y6pDtkJzLPh'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.GetTrainCourseList,
				searchKey: 'V_CourseName',
				value: 'n_Id',
				label: 'v_CourseName',
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['blur', 'change'] }],
		},
		{
			type: 'select',
			label: $t('jdC5sP5yvQ8bkKNnq3dS'),
			key: 'n_TeacherId',
			value: data.v_EmpName || '',
			placeHolder: $t('ehhbmuhU8y6pDtkJzLPh'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getUserList,
				searchKey: 'EmpName',
				value: 'id',
				label: 'name',
				otherParams: {
					IsChoose: false,
				},
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['blur', 'change'] }],
		},
		{
			type: 'select',
			label: $t('uDe8zDxRpVvw4uzVo0ER'),
			key: 'empStr',
			value: data.trainEmps || '',
			placeHolder: $t('ehhbmuhU8y6pDtkJzLPh'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getUserList,
				searchKey: 'EmpName',
				value: 'id',
				label: 'name',
				multiple: true,
				collapseTags: true,
				otherParams: {
					IsChoose: false,
				},
			},
			disabledStyle: true,
			rules: [{ required: true, message: $t('key_0'), trigger: ['change'] }],
		},

		{
			type: 'input',
			label: $t('tZigqaTeZHrEpIzEfFXf'),
			key: 'v_TrainAddress',
			value: data.v_TrainAddress || '',
			placeHolder: $t('e5BiDhajqpw5JoqNtmVs1'),
			rules: [{ required: true, message: $t('7LkKYu4Cp4ATlKfAm3kZ'), trigger: ['blur', 'change'] }],
		},
		{
			type: 'number',
			label: $t('fGxLvKmQXtCd8DzaE8Zb'),
			key: 'n_Durations',
			value: data.n_Durations || '',
			placeHolder: $t('xxarazNXetETcHiUw7tQ'),
			labelWidth: 130,
			rules: [
				{ required: true, message: $t('7LkKYu4Cp4ATlKfAm3kZ'), trigger: ['blur', 'change'] },
				{ type: 'number', message: $t('xue4GymJLcOjCshG1ay3'), trigger: ['change', 'blur'] },
			],
		},
		{
			type: 'date',
			label: $t('xH6WyU5aZqeTaCkop1jrH'),
			key: 'd_TrainTime',
			value: data.d_TrainTime || '',
			placeholder: $t('xUuIxjDxMKrGxHa2oZw20'),
			//选择一个日期时间
			dateOption: {
				type: 'datetime',
				format: 'YYYY-MM-DD HH:mm:ss',
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['blur', 'change'] }],
		},
		{
			type: 'checkbox',
			label: $t('s0Db8OpDUrYNjBlUpYoP'),
			key: 'v_AssessmentMethod',
			value: data.v_AssessmentMethod || [],
			rules: [{ required: true, message: $t('key_0'), trigger: ['change', 'blur'] }],
			options: [
				{
					value: $t('2ZIddzTpQG7z9WjpJHy'),
					label: $t('o8Crz6rC5auuHHddNoHnT'),
				},
				{
					value: $t('pUbjOrqUbuOqFidDsWb'),
					label: $t('yT8wPu1VGqHAyja26J0_4'),
				},
				{
					value: $t('nstMaxiqPmIwSo29Vjob'),
					label: $t('uLx4H5wDzoc7FqfvqgCC'),
				},
			],
		},

		{
			type: 'radio',
			label: $t('sfwbsExMM3lGjDuN5zHf'),
			key: 'n_isValid',
			value: data.n_isValid || 1,
			options: [
				{
					value: 1,
					label: $t('iPfonvtxVLm7knSyCsLBo'),
				},
				{
					value: 2,
					label: $t('tzm8JwYsKnqKoNhheJlJx'),
				},
			],
		},
		{
			type: 'textarea',
			label: $t('9RLaVEiJf1Z1Qv15o6Kll'),
			key: 'v_Remake',
			value: data.v_Remake || '',
		},

		{
			type: 'slot',
			slotName: 'tint1',
			label: $t('s4KbtSrTfOzuWyRcHgTxx'),
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		{
			type: 'slot',
			slotName: 'PlanFile',
		},
		{
			type: 'slot',
			slotName: 'Detail',
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
	];
	return array;
}
